#include"p.h"
#include<unistd.h>

double total=1024.0;
double speed=1.0;

//模拟下载环境
void download()
{
    double cur=0;
    while(cur<=total)
    {
        usleep(3000);//模拟从网络上下载
        progress_v2(cur,total);
        cur+=speed;
    }

    printf("\ndownload %.2fMB\n",cur);
}


int main()
{
    download();
}
